<?php
App::uses('AppController', 'Controller');
/**
 * Lukas Controller
 *
 * @property Luka $Luka
 */
class LukasController extends AppController {

/**
 * add method
 *
 * @return void
 */
	/*public function add() {
		if ($this->request->is('post')) {
			$this->Luka->create();
			if ($this->Luka->save($this->request->data)) {
				$this->Session->setFlash(__('The PDF trademark has been saved'),'default', array('class' => 'savesuccess'));
				$this->redirect(array('controller' => 'orders','action' => 'index'));
			} else {
				$this->Session->setFlash(__('The PDF trademark could not be saved. Please, try again.'),'default', array('class' => 'saveerror'));
			}
		}
	}*/

/**
 * edit method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function edit($id = null) {
		if (!$this->Luka->exists($id)) {
			throw new NotFoundException(__('Invalid luka'));
		}
		if ($this->request->is('post') || $this->request->is('put')) {
			if ($this->Luka->save($this->request->data)) {
				$this->Session->setFlash(__('The PDF trademark has been saved'),'default', array('class' => 'savesuccess'));
				$this->redirect(array('controller' => 'orders','action' => 'index'));
			} else {
				$this->Session->setFlash(__('The PDF trademark could not be saved. Please, try again.'),'default', array('class' => 'saveerror'));
			}
		} else {
			$options = array('conditions' => array('Luka.' . $this->Luka->primaryKey => $id));
			$this->request->data = $this->Luka->find('first', $options);
		}
	}

/**
 * delete method
 *
 * @throws NotFoundException
 * @throws MethodNotAllowedException
 * @param string $id
 * @return void
 */
	/*public function delete($id = null) {
		$this->Luka->id = $id;
		if (!$this->Luka->exists()) {
			throw new NotFoundException(__('Invalid luka'));
		}
		$this->request->onlyAllow('post', 'delete');
		if ($this->Luka->delete()) {
			$this->Session->setFlash(__('Luka deleted'));
			$this->redirect(array('action' => 'index'));
		}
		$this->Session->setFlash(__('Luka was not deleted'));
		$this->redirect(array('action' => 'index'));
	}*/
}
